class GenExp
!!!192770.cpp!!!	GenExp()




!!!192898.cpp!!!	~GenExp()


!!!193026.cpp!!!	genExp(inout type : IType, inout currentContext : ) : IExp

	IExp* ret = NULL;


	m_Type = type;
	m_currentContext = currentContext;

	if( m_Mode == TerminalState::RANDOM )
	{
		// We need to figure out, randomly, if this is to be a Terminal or a non-terminal..
		m_Mode = genTerminalMode();

	}


	if( m_Mode == TerminalState::TERMINAL)
	{
		ret = handleTerminal();
	}else if( m_Mode == TerminalState::NON_TERMINAL )
	{
		ret = handleNonTerminal();
	}


	return ret;
!!!193154.cpp!!!	genTerminalMode()


	int nr = TerminalState::size();
	//becomes either Terminal OR Non-Terminal
	//Since we removed RANDOM we have nr - 1...
	unsigned char ordinal = (rand()%(nr-1) );
	assert(TerminalState::isOrdinalInRange(ordinal));
	const TerminalState& mode = TerminalState::fromOrdinal(ordinal);


	return mode;
!!!193282.cpp!!!	genTerminals()

	/*
	 * 	first check that there is Idents
	 * 	if not we can only use constant numbers.
	 */

	int nr = Terminals::size();
	unsigned char ordinal = (rand()%nr); //becomes either Constant or Ident
	assert(Terminals::isOrdinalInRange(ordinal));
	Terminals mode = Terminals::fromOrdinal(ordinal);
	return mode;

!!!193410.cpp!!!	handleTerminal() : IExp

	IExp* ret = NULL;

	Terminals mode = genTerminals();

	if( mode == Terminals::CONSTANT)
	{
		ret = genConstant();
	}else if ( mode == Terminals::IDENT)
	{
		/*
		 * need to check if there exists any ident in context.
		 * a list of idents from the context with that specific type
		 * choose randomly that indent. If no ident exists
		 * then we can't use ident so we shouldt be here!
		 * Check before
		 */


		ret = handleIdent();
	}




	return ret;
!!!193538.cpp!!!	handleNonTerminal() : IExp

	return NULL;

!!!193666.cpp!!!	genConstant() : IExp

	GenConstant constant(m_Type);

	return constant.genConstant();
!!!193794.cpp!!!	handleIdent() : IdentExp

	IdentExp *ret = NULL;
	IContext::TypeList list;
	m_currentContext->getAllOfType(m_Type,list);

	if( !list.empty() )
	{
		//Choose the ident ,
		// otherwise we return NULL

	}
	return ret;
